Skip to main content

Applying advanced automation techniques and best practices

5 Tasks

35 mins

Pega Robotic Automation 22.1
Visible to: All users
Beginner Pega Robotic Automation 22.1 Robotic Process Automation English

Scenario

While running the Robotic Banking automation, you decide that reorganizing the project will improve efficiency and better align with best practices. Updating the project also allows your team to organize and categorize error messages in preparation for deployment, making error messages easier to track in Production.

Complete the following tasks:

  • Add a Message Manifest to the Robotic Banking project with message definitions that categorizes all error messages
  • Refactor the Pega login and customer search automations into application methods
  • Create an automation to use new application methods and message manifest capabilities​

You must initiate your own Pega instance to complete this Challenge.

Initialization may take up to 5 minutes so please be patient.

Detailed Tasks

1 Add the message manifest

  1. Download and unpack the folder containing the Advance automation techniques zip file and move it to C:\Users\<username>\Documents\Pega Robot Studio\
  2.  Open the RoboticBanking.pegaProject in Pega Robot Studio.
  3. In the project explorer, click the Information icon next to the Robotic Banking to display the properties grid.
    Project properties icon
  4. In the Runtime section, click the More icon to open the Message manifest dialog.
    In the project properties pane, the message manifest menu icon in the Runtime section
  5. In the Message definitions window, click Add and then add the following parameters to a new message definition:

    Variable

    Value

    Code

    PEGA101

    Include code in dialog

    Checked

    Caption

    Pega Finance

    Icon

    Error

    Button

    OK

    Default button

    Button1

    Message

    Customer table unavailable

  6. In the Edit message definition window, select the Submit button to add the Message manifest definition.
    The Edit message definition dialog box.
  7. In the Message definitions window, click Add to add another message definition.
    The Edit message definition dialog box.
  8. In the Edit message definition dialog box, click Submit.
  9. In the Message definitions window, click Done.
    The Message definitions form with two message definitions added.

2 Edit automations to use the new message manifest

 

  1. On the Project Explorer, right-click the Finance_CustomerSearch automation and click Open.
  2. Click the inside each of the Jump To Error blocks and replace the error text with the matching Message manifest code, as follows

    Old Error

    Message manifest code

    Customer table unavailable

    PEGA101

    Customer not found

    PEGA102

     
    The Finance_CustomerSearch automation with message definition codes updated.
  3. On the Toolbar, click Save to save the automation.

3 Refactor automations into application methods

  1. In the Project Explorer, select BillPaySystemDiscount to open the automation.
  2. Hold Ctrl on your keyboard and then select the Finance_Login and the Finance_CustomerSearch design blocks.
  3. Right-click to display the context menu and then click Delete to remove Finance_Login and the Finance_CustomerSearch design blocks from the automation.
    The right-click menu with the option to delete design blocks from the automation surface.
  4. On the automation surface, delete Jump To Error, and accountNumber design blocks.
    The automation surface with design blocks to be removed.
  5. In the toolbar, click the Include button and unselect the Finance_Login automation to remove the references from the automation.
  6. Repeat step 5 to remove references to the Finance_CustomerSearch automation.
  7. Click Done to save your changes
    Remove login and customer search automation from BillPaySystemDiscount automation
  8. In the toolbar, click the Project tab to open the Project explorer.
  9. Click and drag the Finance_Login automation and place it on top of the Pega Finance application, to add it as an application method
  10. Click and drag the Finance_CustomerSearch automation and add it as an application method. 
  11. Right-click the Finance_CustomerSearch application method, click Rename and change the name to CustomerSearch.
  12. Right-click the Finance_Login application method, click Rename and change the name to Login.
  13. In the list of project items, click the Pega Finance application to open the application in a new tab.
  14. On the Pega Finance tab, click the Interface tab, and then select the CustomerSearch method.
  15. Click the Visibility type list and then select Public to change the method visibility.
    The Interface tab of the Pega Finance application with the option to change the visibility of the application method.
  16. On the Interface Tab, select the Login method and update its visibility setting to Public.
  17. At the top of the toolbar, click Save to save your application changes. 

4 Create a new automation with application methods

  1. In the toolbar, click the Project tab and navigate to the project explorer.
  2. In the toolbar, click Add > Automation to create a new automation, and name it Finance_RetrieveCustomerData.
    Adding the new Finance_RetrieveCustomerData automation
  3. In the toolbar, click the Include button, click the Application tab, and then add the Pega Finance application to the automation.
  4. Add the following design blocks to the automation surface:

    Design block name

    Actions

    Login application method

    1. In the palette, expand the Applications section, and drag the Pega Finance application onto the automation surface.
    2. In the Select action dialog box, click More and select Method.
    3. In the Search box, enter Login, and then select the Login method.
    4. In the Select action dialog box, click the Add button.

    CustomerSearch application method

    1. In the palette, click the Pega Finance application and drag it onto the automation surface.
    2. In the Select action dialog box, click More and select Method.
    3. Select the CustomerSearch method.
    4. In the Select action dialog box, click the Add button.

    Entry point

    1. Right-click the automation surface and then click Add > Entry Point.
    2. In the Run design block, click the +  icon.
    3. Click String parameter > param1 and then enter accountNumber.

    Exit point

    1. Right-click the automation surface and then click Add > Exit Point.
    2. Click inside the exit point and rename it to Exit Point.
    3. On the exit point, click the + icon.
    4. Click String parameter > param1 and then enter errMessage.
    5. Click Void and change the type to Boolean.

    Exit label

    1. Right-click the automation surface and then click Add > Label.
    2. Click inside the label and rename it Exit.
    3. On the Exit label, click the + icon.
    4. Click String and change the type to Boolean.
    5. Click param1 and then enter Result.

    Error label

    1. Right-click the automation surface and then click Add > Label.
    2. Click inside the label and rename it Error.
    3. On the Error label, click the + icon.
    4. Click param1 and then enter errMessage.
    errMessage property
    1. On the palette, expand Locals > Run section, and then drag the errMessage parameter to the automation surface.

    Jump To Exit

    1. Right-click the automation surface, and then select Jump To > Exit.
    2. Click the Result, and then select False.

    Two Jump To Error design blocks

    1. Right-click the automation surface, and then select Jump To > Error.
    Jump to Exit
    1. Right-click the automation surface, and then select Jump To > Exit.
    2. Click the Result, and then select True.
  5. Connect the design blocks as shown in the following figure:
    The Finance_RetrieveCustomerData automation with automation and data links connected.
  6. On the toolbar, click Save to save the automation. 

5 Set up BillPaySystemDiscount to use a new subautomation

  1. Click the Project tab and navigate to the Project explorer.
  2. In the project items list, select the BillPaySystemDiscount automation.
  3. In the toolbar click Include.
  4. In the Include in palette dialog box, next to Finance_RetrieveCustomerData, click Add to add the automation.
    Include Finance_RetrieveCustomerData automation in the BillPaySystemDiscount automation
  5. In the Include in palette window, click Done to return to the automation.
  6. In the palette, click and drag the Finance_RetrieveCustomerData automation onto the automation surface.
  7. In the Select Action window, select the Run method, then click Add.
  8. In the Toolbox, click Accelerators > MessageManifest.
    The ShowMessage option in the MessageMManifest section of the toolbox
  9. In the the Toolbox, in the MessageManifest section, click and drag the ShowMessage block onto the automation surface.
  10. In the ShowMessage() window, select the first option and then click Submit.
    ShowMessage overload options
  11. On the automation surface, connect the links as shown in the following figure:
The BillPaySystemDiscount automation with updated design blocks selected.

Confirm your work

  1. From within the BillPaySystemDiscount automation, right-click on the automation link next to the Run block and select Toggle breakpoint.
    Toggle breakpoint on automation link in BillPaySystemDiscount
  2. On the toolbar, click the green Test button to begin the automation.
  3. In the accountNumber field, enter 1010101 and press the blue Test button.
  4. From the toolbar press Step-over or F10.
  5. Verify that the error code on the Finance_RetrieveCustomerData application method equals PEGA102.
    The first verification step - observing the error code value on the automation surface.
  6. From the toolbar, press Step-over or F10 until the execution stops and the dialog box is displayed.
  7. Verify that the Message Manifest method correctly decoded the error code, and displayed the text Customer not found.
    The Pega Finance dialog box with the error and error code.
  8. In the Pega Finance dialog box, click OK to close the message box.
  9. From the toolbar, click Continue to finish the test and display the Test complete dialog box.
  10. On the testing window, click the Done button to close the testing session.
    The Test complete window showing the test result.


Available in the following mission:

If you are having problems with your training, please review the Pega Academy Support FAQs.

Did you find this content helpful?

Want to help us improve this content?

We'd prefer it if you saw us at our best.

Pega Academy has detected you are using a browser which may prevent you from experiencing the site as intended. To improve your experience, please update your browser.

Close Deprecation Notice